<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
    
    <title>提醒</title>
    <link rel="icon" href="https://cp1.douguo.com/static/nweb/images/favicon.ico?v=1912" type="image/x-icon">
    <link rel="stylesheet" href="./static/css/main.css">
            <link rel="stylesheet" href="./static/css/remind.css">
        <script src="./static/js/osd.js.下载"></script><script src="./static/f.txt" id="google_shimpl"></script><script src="./static/js/hm.js.下载"></script><script src="./static/js/jquery.js.下载"></script>
    <script data-ad-client="ca-pub-6608973961595981" async="" src="./static/f(1).txt" data-checked-head="true"></script>
    <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?f4fa5d56f272ae0a0777feec2184a97f";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
<link rel="preload" href="./static/f(2).txt" as="script"><script type="text/javascript" src="./static/f(2).txt"></script></head>
<body>
<jsp:include page="/inc/head.jsp"></jsp:include>
<script>
    //var time=Date.parse(new Date());
    $.ajax({
        url: "/login/user?time="+new Date().getTime(),
        data:"",
        success:function(res) {
            var headhtml="";
            if(res.data.user.user_id){//登录
                var user=res.data.user;
       // 发布弹窗
                headhtml+='<div class="pubt" onmouseover="javascript:$(\'.pubt-box\').show();" onmouseout="javascript:$(\'.pubt-box\').hide();"> <a class="btn-pubt" href="javascript:void(0);">发布</a> <div class="pubt-box br8"> <span class="arwwj"> </span> <a href="/upfood.html">发布菜谱</a> <a href="/caidan/create">创建菜单</a>';
                if(user.is_create_article){
                    headhtml+='<a href="/uparticle.html">发布长笔记</a>';
                }
                if(user.is_create_video){
                    headhtml+='<a href="/video/upvideo">发布视频</a>';
                }
                headhtml+="  </div> </div>";
                //头像
                headhtml+='<div class="myinfo relative" onmouseover="javascript:$(\'.myedit\').show();" onmouseout="javascript:$(\'.myedit\').hide();"> <a class="headicon" href="/u/'+user.username+'.html"> <img class="wb100 br50" src="'+user.headicon+'" alt=""> <span class="msgnum"></span> </a> <div class="myedit br8"> <span class="arwwj"> </span> <a class="relative" href="/message/remind/1" target="_blank">消息提醒 <span class="boll"></span> </a> <a href="/u/'+user.username+'/collect">我的收藏</a> <a href="/draft/recipe">草稿箱</a> <a href="/user/profile" target="_blank">账号设置</a> <a href="/logout?v=1540878216">退出</a> </div> </div>';
            }else{//未登录
                headhtml+='<div class="pubt" onmouseover="javascript:$(\'.pubt-box\').show();" onmouseout="javascript:$(\'.pubt-box\').hide();"> <a class="btn-pubt" href="javascript:void(0);">发布</a> <div class="pubt-box br8"> <span class="arwwj"> </span> <a href="/upfood.html">发布菜谱</a> <a href="/caidan/create">创建菜单</a> </div> </div> <div class="perinfo"> <a class="login" href="/login"> 登录 </a> | <a class="register" href="/signup.html" target="_blank"> 注册 </a></div>';
            }
            $("#header .header").append(headhtml);
        }
    });
</script>
<div id="content" class="clearfix">
    <div class="type-head clearfix" style="margin-top:15px;">
        <a href="https://www.douguo.com/message/remind/1">评论及回复</a>
        <a href="https://www.douguo.com/message/remind/2">收藏及喜欢</a>
        <a href="https://www.douguo.com/message/remind/3" class="active">关注提醒</a>
        <a href="https://www.douguo.com/message/remind/4">官方通知</a>
    </div> 
    <ul class="remind-list mh600  msglist ">
                            <li class="item clearfix relative" data-id="75943085">
                <a href="" class="user-img">
                    <img src="./static/image/70_u73468444615195123131.jpg" alt="死心zbwp">
                </a>
                                <div class="info">
                    <a class="nickname" href="">死心zbwp</a>
                    <p class="msg"> 关注了你死心zbwp关注了你</p>
                </div>
                                <div class="operating">
                                        <a href="javascript:;" onclick="delMsg(this,&#39;26046082&#39;,&#39;75943085&#39;,&#39;XJm8NIr9iQCC6AGzQDtwakqpnbZFS3MUFh73gVXs&#39;)" class="delete" style="visibility: hidden">删除</a>
                </div>
                <p class="time">2020-10-20 15:27:24</p>
            </li>
                    </ul>
    <div id="loading" class="loading" style="text-align: center;padding-top: 20px"></div>
        <!-- <div class="deleteAll clearfix">
        <a href="javascript:;" onclick="emptyMsg('26046082','3','XJm8NIr9iQCC6AGzQDtwakqpnbZFS3MUFh73gVXs')" class="delete">删除全部提醒</a>
    </div> -->
        <p class="fcc">你当前的位置：<a href="" target="_blank">豆果美食</a> &gt; 消息中心</p>
</div>
<script>
    var group_id="3"=="7"?"4":"3",offset=20,isFetch=false,isEnd=0;token="XJm8NIr9iQCC6AGzQDtwakqpnbZFS3MUFh73gVXs";
    $(window).scroll(function(){
        var pheight = window.screen.availHeight;
        var documentHeight = document.body.scrollHeight;
        var scrollTop = document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
        if(scrollTop + pheight>documentHeight - 80 && isFetch != true && isEnd !=1) {
            showLoading();
            getlist();
        }
    });
    function getlist(){
        isFetch=true;
        $.ajax({
            url:"/message/remind/"+group_id+"/"+offset,
            type:'get',
            success:function(res){
                var lists = res.data.list;
                if(res.errcode==0 && lists){
                    hideLoading();
                    var len  = lists.length;
                    var html = "";
                    for(var i=0;i<len;i++){
                        if(typeof lists[i]["qp"] == 'undefined'){
                            lists[i]["qp"] = '';
                        }
                        if(typeof lists[i]["qc"] == 'undefined'){
                            lists[i]["qc"] = '';
                        }
                        item = '<li class="item clearfix" data-id="'+lists[i]["id"]+'"><p class="time">'+lists[i]["createdate"]+'</p><a href="/u/'+lists[i]['user']["username"]+'.html" class="user-img"> <img src="'+lists[i]['user']["headicon"]+'" alt="'+lists[i]['user']["nickname"]+'"></a>';
                        if(group_id==3){
                            item +='<div class="info"><a class="nickname" href="/u/'+lists[i]['user']["username"]+'.html">'+lists[i]['user']["nickname"]+'</a> <p class="msg">'+lists[i]["qp"]+lists[i]["qc"]+lists[i]["content"]+'</p></div><div class="operating">';
                        }else{
                            item +='<div class="msginfo"><a class="nickname" href="/u/'+lists[i]['user']["username"]+'.html">'+lists[i]['user']["nickname"]+'</a>  <p class="msg">'+lists[i]["qp"]+lists[i]["qc"]+lists[i]["content"]+'</p></div><div class="operating">';
                        }
                        if(lists[i]["object_image_url"]){
                            var img_url = lists[i]["object_image_url"];
                            var uid = '26046082';
                            var id = lists[i]["id"];
                            var token = 'XJm8NIr9iQCC6AGzQDtwakqpnbZFS3MUFh73gVXs';
                            item +='<a class="cover" style="background: url() no-repeat center center;background-size:cover;" href="' + img_url + '"></a> <a href="javascript:;" onclick="delMsg(this,'+ uid  +','+ id +','+ token +')" class="delete" style="visibility: hidden">删除</a>';
                        }else{
                            item += '<a href="javascript:;" onclick="delMsg(this,\'+ uid  +\',\'+ id +\',\'+ token +\')" class="delete" style="visibility: hidden">删除</a>';
                        }
                        item += '</div></li>';
                        html += item;
                    }
                    $(".remind-list").append(html);
                    offset += 20;
                    isFetch=false;
                    isEnd = res.data.end;
                }
            }
        })
    }
    function delMsg(that,user_id,id,token) {
        showMotai('确认删除信息吗？',function(){
            $.ajax({
                url:"/message/del/",
                data:{'user_id':user_id,'msg_id':id,'_token':token},
                type:'post',
                success:function(res){
                    // tip({text:res.msg});
                    $(that).parents().parents("li").remove();
                }
            })
        });
    }
    function emptyMsg(user_id,group_id,token) {
        showMotai('是否删除所有消息？',function(){
            $.ajax({
                url:"/message/empty/",
                data:{'user_id':user_id,'type':group_id,'_token':token},
                type:'post',
                success:function(res){
                    // tip({text:res.msg});
                    $(".remind-list").html("");
                }
            })
        });
    }
    $.ajax({
        url:"/message/unread",
        data:{'user_id':'26046082'},
        type:'get',
        success:function(res){
            if(res.data.unread_count > 0){
                $("#header").find(".msgnum").show();
            }else{
                $("#header").find(".msgnum").hide();
            }
            $("#header").find(".msgnum").text(res.data.unread_count);
        }
    })
    
    function showLoading() {
        let load = '<img style="display:inline-block;width:13px" src="https://cp1.douguo.com//static/nweb/images/loading.gif"><span style="    margin-left: 10px;font-size: 13px;line-height: 10px;">正在加载中....</span>'
        hideLoading();
        $('#loading').append(load);
    }
    function hideLoading() {
        $("#loading").empty();
    }
    
</script>

<script src="./static/js/tip.js.下载"></script>
<script src="./static/js/search.js.下载"></script>
<script src="./static/js/main.js.下载"></script>
<!-- <script src='https://s13.cnzz.com/c.php?id=30029854' language='JavaScript' charset='gb2312'></script> -->

<ins class="adsbygoogle adsbygoogle-noablate" data-adsbygoogle-status="done" style="display: none !important;"><ins id="aswift_0_expand" style="display:inline-table;border:none;height:0px;margin:0;padding:0;position:relative;visibility:visible;width:0px;background-color:transparent;"><ins id="aswift_0_anchor" style="display:block;border:none;height:0px;margin:0;padding:0;position:relative;visibility:visible;width:0px;background-color:transparent;"><iframe id="aswift_0" name="aswift_0" style="left:0;position:absolute;top:0;border:0;width:undefinedpx;height:undefinedpx;" sandbox="allow-forms allow-popups allow-popups-to-escape-sandbox allow-same-origin allow-scripts allow-top-navigation-by-user-activation" frameborder="0" src="./static/ads.html" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true" data-google-container-id="a!0" data-load-complete="true"></iframe></ins></ins></ins><iframe id="google_osd_static_frame_4057622627160" name="google_osd_static_frame" style="display: none; width: 0px; height: 0px;" src="./static/saved_resource.html"></iframe></body><iframe id="google_esf" name="google_esf" src="./static/zrt_lookup.html" data-ad-client="ca-pub-6608973961595981" style="display: none;"></iframe></html>